package chixing.day11.work.w9;

public class HR implements Approver {
    private String name;

    public HR(String name) {
        this.name = name;
    }

    @Override
    public void approve(ApprovalRequest request) {
        if (request instanceof LeaveRequest) {
            LeaveRequest leaveRequest = (LeaveRequest) request;
            System.out.println("申请人: " + request.getApplicant());
            System.out.println("申请时间: " + request.getRequestTime());
            System.out.println("申请说明: " + request.getDescription());
            System.out.println("请假天数: " + leaveRequest.getDays() + "天");

            System.out.println("人事 " + name + " 已记录并批准该请假申请");
        } else {
            System.out.println("人事 " + name + " 不处理" + request.getRequestType());
        }
        System.out.println("------------------------");
    }
}

